function R = convertAngleAxis2RotationMatrix(theta, vec)
    
    x = vec(1);
    y = vec(2);
    z = vec(3);
    
    s = sin(theta);
    c = cos(theta);
    d = 1-c;
    
    r11 = x^2*d+c;
    r12 = x*y*d-z*s;
    r13 = x*z*d+y*s;
    
    r21 = x*y*d+z*s;
    r22 = y^2*d+c;
    r23 = y*z*d-x*s;
    
    r31 = x*z*d-y*s;
    r32 = y*z*d+x*s;
    r33 = z^2*d+c;
    
    R = [ r11 r12 r13 ;
          r21 r22 r23 ;
          r31 r32 r33 ];